package com.tjhzzx.hnceCore2024.model.dashboard;

import javax.baja.sys.*;

public class BPieGroup extends BBaseChart {

    public BPieGroup() {
        setTitle("PieGroup#");
    }

    public static final Property fontSize = newProperty(0, "16px", null);

    public String getFontSize() {
        return getString(fontSize);
    }

    public void setFontSize(String v) {
        setString(fontSize, v, null);
    }

    public static final Property ring = newProperty(0, false, null);

    public boolean getRing() {
        return getBoolean(ring);
    }

    public void setRing(boolean v) {
        setBoolean(ring, v, null);
    }

    @Override
    public void added(Property property, Context context) {
        super.added(property, context);
        if(property.getType().is(BPieItem.TYPE)) {
            String name = property.getName();
            BPieItem prop = (BPieItem)this.get(name);
            prop.setColor(colors[BAbsTime.now().getSecond()%colors.length]);
        }
    }

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BPieGroup.class);

}
